/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.imyours.model.department;

import java.io.Serializable;

import com.imyours.model.user.UserEntity;

/**
 *DutyEntity's composite-id
 * @author Slevenc
 */
public class DutyEntityId implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -1035344434876446778L;
	private UserEntity user;
    private DepartmentEntity department;

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof DutyEntityId){
            DutyEntityId di = (DutyEntityId)obj;
            if(this.user.equals(di.user)&&this.department.equals(di.department)){
                return true;
            }
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 19 * hash + (this.user != null ? this.user.hashCode() : 0);
        hash = 19 * hash + (this.department != null ? this.department.hashCode() : 0);
        return hash;
    }

    /**
     * @return the user
     */
    public UserEntity getUser() {
        return user;
    }

    /**
     * @param user the user to set
     */
    public void setUser(UserEntity user) {
        this.user = user;
    }

    /**
     * @return the department
     */
    public DepartmentEntity getDepartment() {
        return department;
    }

    /**
     * @param department the department to set
     */
    public void setDepartment(DepartmentEntity department) {
        this.department = department;
    }
    
    
    
    
    
}
